package less01.ioc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestCotainer {
	public static void main(String[] args) {
		ApplicationContext context= new ClassPathXmlApplicationContext("classpath:/less01/ioc/spring.xml");
		A a=(A)context.getBean("b1");
		System.out.println(a.getName());
		B b=(B)context.getBean("b");
		System.out.println(b.getA().getName());
		C c=(C)context.getBean("c");
		System.out.println(c.getName()+"---"+c.getId()+"---"+c.getB().getA().getName());
	}
}
